import request from '@/utils/request'

// 查询收付款单列表
export function listPayment(query) {
  return request({
    url: '/settle/payment/list',
    method: 'post',
    data: query
  })
}

// 查询收付款单详细
export function getPayment(id) {
  return request({
    url: '/settle/payment/' + id,
    method: 'get'
  })
}

// 新增收付款单
export function addPayment(data) {
  return request({
    url: '/settle/payment/add',
    method: 'post',
    data: data
  })
}

// 修改收付款单
export function updatePayment(data) {
  return request({
    url: '/settle/payment/update',
    method: 'post',
    data: data
  })
}

// 删除收付款单
export function delPayment(id) {
  return request({
    url: '/settle/payment/delete/' + id,
    method: 'post'
  })
}

// 审核付款单
export function auditPayment(id) {
  return request({
    url: '/settle/payment/audit/' + id,
    method: 'post'
  })
}

// 取消审核付款单
export function auditCancelPayment(id) {
  return request({
    url: '/settle/payment/auditCancel/' + id,
    method: 'post'
  })
}

// 关闭付款单
export function closePayment(data) {
  return request({
    url: '/settle/payment/close',
    method: 'post',
    data: data
  })
}

// 核销付款单
export function paymentCheckSettleBill(data) {
  return request({
    url: '/settle/payment/checkSettleBill',
    method: 'post',
    data: data
  })
}